import axios from 'axios'
// 注册
export const SignIn = params => {
  return axios({
    method: 'post',
    url: '/api/login/createUser',
    dataType: 'json',
    data: params
  })
}
// 登录
export const LoginIn = params => {
  return axios({
    method: 'post',
    url: '/api/login/getAccount',
    dataType: 'json',
    data: params
  })
}
// 获取用户信息
export const getUser = params => {
  return axios({
    method: 'post',
    url: '/api/index/getUser',
    dataType: 'json',
    data: params
  })
}
// 写入修改用户信息
export const setUser = params => {
  return axios({
    method: 'post',
    url: '/api/index/setUser',
    dataType: 'json',
    data: params
  })
}
// 修改账号密码
export const setPassword = params => {
  return axios({
    method: 'post',
    url: '/api/index/setPassword',
    dataType: 'json',
    data: params
  })
}
// 创建帖子 发布帖子功能
export const createPost = params => {
  return axios({
    method: 'post',
    url: '/api/post/createPost',
    dataType: 'json',
    data: params
  })
}
// 修改某个帖子的点赞人数
export const setLikeList = params => {
  return axios({
    method: 'post',
    url: '/api/post/setLikeList',
    dataType: 'json',
    data: params
  })
}
// 修改某个评论 的点赞人数
export const setCommentLikeList = params => {
  return axios({
    method: 'post',
    url: '/api/post/setCommentLikeList',
    dataType: 'json',
    data: params
  })
}
// 修改我的收藏
export const setStar = params => {
  return axios({
    method: 'post',
    url: '/api/user/setStar',
    dataType: 'json',
    data: params
  })
}
// 修改某个帖子的阅读人数
export const setReadNum = params => {
  return axios({
    method: 'post',
    url: '/api/post/setReadNum',
    dataType: 'json',
    data: params
  })
}
// 创建模块
export const createModule = params => {
  return axios({
    method: 'post',
    url: '/api/module/createModule',
    dataType: 'json',
    data: params
  })
}
// 查询所有模块
export const getModule = params => {
  return axios({
    method: 'post',
    url: '/api/module/getModule',
    dataType: 'json',
    data: params
  })
}
// 查询某个模块
export const getOneModule = params => {
  return axios({
    method: 'post',
    url: '/api/module/getOneModule',
    dataType: 'json',
    data: params
  })
}
// 插入某个模块的postID
export const setPostID = params => {
  return axios({
    method: 'post',
    url: '/api/post/setPostID',
    dataType: 'json',
    data: params
  })
}
// 查询某个模块的帖子
export const getModulePost = params => {
  return axios({
    method: 'post',
    url: '/api/post/getModulePost',
    dataType: 'json',
    data: params
  })
}
// 查询所有帖子
export const getAllPost = params => {
  return axios({
    method: 'post',
    url: '/api/post/getAllPost',
    dataType: 'json',
    data: params
  })
}
// 查询我的帖子
export const getMyPost = params => {
  return axios({
    method: 'post',
    url: '/api/post/getMyPost',
    dataType: 'json',
    data: params
  })
}
// 查询我的收藏的帖子
export const getMyStarPost = params => {
  return axios({
    method: 'post',
    url: '/api/post/getMyStarPost',
    dataType: 'json',
    data: params
  })
}
// 查询我的评论的帖子
export const getMyCommentPost = params => {
  return axios({
    method: 'post',
    url: '/api/post/getMyCommentPost',
    dataType: 'json',
    data: params
  })
}
// 查询我的点赞过的帖子
export const getMyLikePost = params => {
  return axios({
    method: 'post',
    url: '/api/post/getMyLikePost',
    dataType: 'json',
    data: params
  })
}
// 查询某个帖子的帖子信息
export const getPostDetail = params => {
  return axios({
    method: 'post',
    url: '/api/post/getPostDetail',
    dataType: 'json',
    data: params
  })
}
// 创建帖子评论
export const createCommentList = params => {
  return axios({
    method: 'post',
    url: '/api/post/createCommentList',
    dataType: 'json',
    data: params
  })
}
// 根据id,删除帖子
export const removePost = params => {
  return axios({
    method: 'post',
    url: '/api/post/removePost',
    dataType: 'json',
    data: params
  })
}
// 首页获取公告 前三条
export const getNotice = params => {
  return axios({
    method: 'post',
    url: '/api/notice/getNotice',
    dataType: 'json',
    data: params
  })
}
// 根据id查找公告详情
export const getNoticeDetail = params => {
  return axios({
    method: 'post',
    url: '/api/notice/getNoticeDetail',
    dataType: 'json',
    data: params
  })
}
// 修改某个公告的阅读人数
export const setNoticeReadNum = params => {
  return axios({
    method: 'post',
    url: '/api/notice/setNoticeReadNum',
    dataType: 'json',
    data: params
  })
}
// 获取所有公告
export const getAllNotice = params => {
  return axios({
    method: 'post',
    url: '/api/notice/getAllNotice',
    dataType: 'json',
    data: params
  })
}
// 删除评论
export const deletePostcomment = params => {
  return axios({
    method: 'post',
    url: '/api/post/deletePostcomment',
    dataType: 'json',
    data: params
  })
}
// 获取用户或者帖子
export const getSearch = params => {
  return axios({
    method: 'post',
    url: '/api/search/getSearch',
    dataType: 'json',
    data: params
  })
}
// 修改某个帖子的被举报次数
export const setReportList = params => {
  return axios({
    method: 'post',
    url: '/api/post/setReportList',
    dataType: 'json',
    data: params
  })
}
// 阿里云服务 发送短信
export const sendMSG = params => {
  return axios({
    method: 'post',
    url: '/api/getMSG',
    dataType: 'json',
    data: params
  })
}
